//
//  VOHFirtView.m
//  VoiceOfHeart
//
//  Created by 吉龙 on 16/8/12.
//  Copyright © 2016年 吉龙. All rights reserved.
//

#import "VOHFirtView.h"



@implementation VOHFirtView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setUpView];
      

    }
    return self;
}



-(void)setUpView{
  
  
//    self.backgroundColor = VOHColor(randomNumber, randomNumber, randomNumber, randomNumber);
//    //首页按钮
//    VOHButton *button = [VOHButton creatButtonWithFrame:CGRectMake(ScreenWidth * 0.5, ScreenHeight * 0.5, 50, 50) Title:@"首页" HighLightImageName:nil ImageName:nil];
//    
//    self.mainButton = button;
//   
//    [self addSubview:button];
//    
//    //音乐按钮
//    self.MusicButton = [VOHButton creatButtonWithFrame:CGRectMake(300, 100, 60, 40) Title:@"Music" HighLightImageName:nil ImageName:nil];
//    [self addSubview:self.MusicButton];
//    //电台按钮
//    self.RadioButton = [VOHButton creatButtonWithFrame:CGRectMake(20, 100, 60, 40) Title:@"Radio" HighLightImageName:nil ImageName:nil];
//    [self addSubview:self.RadioButton];
//
//    //MV按钮
//    self.MVButton = [VOHButton creatButtonWithFrame:CGRectMake(100, 100, 60, 40) Title:@"MV" HighLightImageName:nil ImageName:nil];
//    [self addSubview:self.MVButton];
//
//    //用户按钮
//    self.UserButton = [VOHButton creatButtonWithFrame:CGRectMake(200, 100, 60, 40) Title:@"User" HighLightImageName:nil ImageName:nil];
//    [self addSubview:self.UserButton];
//
    self.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"beijing8"]];
    self.roundMenu = [[XXXRoundMenuButton alloc] init];
    self.roundMenu.bounds = CGRectMake(0, 0, 200, 200);
    self.roundMenu.center = CGPointMake(self.center.x, self.center.y - 200);
    self.roundMenu.backgroundColor = [UIColor whiteColor];
    
    [self addSubview:self.roundMenu];
    
    self.roundMenu.centerButtonSize = CGSizeMake(44, 44);
    self.roundMenu.centerIconType = XXXIconTypeUserDraw;
    self.roundMenu.tintColor = [UIColor whiteColor];
    self.roundMenu.jumpOutButtonOnebyOne = YES;
    
    [self.roundMenu setDrawCenterButtonIconBlock:^(CGRect rect, UIControlState state) {
        
        if (state == UIControlStateNormal)
        {
            UIBezierPath* rectanglePath = [UIBezierPath bezierPathWithRect: CGRectMake((rect.size.width - 15)/2, rect.size.height/2 - 5, 15, 1)];
            [UIColor.whiteColor setFill];
            [rectanglePath fill];
            
            
            UIBezierPath* rectangle2Path = [UIBezierPath bezierPathWithRect: CGRectMake((rect.size.width - 15)/2, rect.size.height/2, 15, 1)];
            [UIColor.whiteColor setFill];
            [rectangle2Path fill];
            
            UIBezierPath* rectangle3Path = [UIBezierPath bezierPathWithRect: CGRectMake((rect.size.width - 15)/2, rect.size.height/2 + 5, 15, 1)];
            [UIColor.whiteColor setFill];
            [rectangle3Path fill];
        }
    }];
    
    [self.roundMenu loadButtonWithIcons:@[
                                          [UIImage imageNamed:@"yinyuePT"],
                                          [UIImage imageNamed:@"zhiboPT"],
                                          [UIImage imageNamed:@"zhuboPT"],
                                          [UIImage imageNamed:@"wodePT"]                                          ] startDegree:0 layoutDegree:M_PI * 1.5];
    
    
    
    
    
}

@end
